<div class="list-body">
	<form id="messages-form" style="padding:0px 20px;">
	<div class="row">
		<div class="search-input">
			<div style="display: none;">
                <input type="text" name="pageCurrent" value="1">
                <input type="text" name="pageSize" value="10">
            </div>
        	  <!-- <button type="button" onclick="submit_btn()" class="search-btn" data-icon="search"></button> -->
    	</div>
	</div>
	<ul class="all-messages">

	</ul>
    </form>
	<div id="pagination_messages" style="text-align: center; display: none;"></div>

</div>
<script type="text/javascript">
	$(function(){
		pagination_callback(1,10,1);
	})
	function pagination_callback(pageCurrent, pageSize,num) {
	    BJUI.ajax('doajax', {
	        url: '/announcement/myAllList',
	        okalert:false,
	        data: {pageCurrent:pageCurrent, pageSize:pageSize},
	        okCallback: function(json, options) {
	        	$('.all-messages').empty();
                $.each(json.list,function(i,item){
					if(item.status==0){
						$('.all-messages').append("<li><div class='content-left'><i class='fa fa-tasks fa-tasks-big'></i></div><div class='content-right'><div><a onclick='read_annou_list(this)' data-title='"+item.title+"' data-content='"+item.content+"' data-id='"+item.announcementid+"'><h4>"+item.title+"</h4></a></div><span>"+item.createdate+"</span></div></li>")
					}else{
						$('.all-messages').append("<li><div class='content-left'><i class='fa fa-tasks fa-tasks-big'></i></div><div class='content-right'><div><a  onclick='read_annou_list(this)' data-title='"+item.title+"' data-content='"+item.content+"' data-id='"+item.announcementid+"'><h4><i class='iconfont icon-yuandianzhong'></i>"+item.title+"</h4></a></div><span>"+item.createdate+"</span></div></li>")
					}
				})
				if(num==1){
                    $('#pagination_messages').pagination({
                        total:json.totalRow, pageSize:10, callback:pagination_callback
                }) 
              }
              // communicationprotocolTotalNum=json.totalRow;
              if(json.totalRow>pageSize){
                $("#pagination_messages").css("display","block");
              }else{
                $("#pagination_messages").css("display","none");
              }
	          }
	     })
	 }
	 function read_annou_list(obj){
	 	if($(obj).find("i")){
	 		$(obj).find("i").remove();
	 		$.ajax({
            url:'/announcement/read',
            type:'post',
            data:{'id':$(obj).attr('data-id')},
            dataType:'json',
            success:function(data){
            	get_unread_bulletin();
            }
        })
	 	}
	 	BJUI.dialog({
            id:'read_annou_list',
            mask:true,
            maxable:false,
            html:'<div class="bjui-pageContent"><p class="change-line plr-10">'+$(obj).attr('data-content')+'</p></div><div class="btns-group bjui-pageFooter"><button onclick="BJUI.dialog(\'closeCurrent\');" class="save-btn">确定</button></div>',
            title:$(obj).attr('data-title')
        })
	 }
</script>